import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/exam/report/opinion/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/exam/auditReports',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/exam/report/opinion/' + id,
    method: 'get'
  })
}

export function getReport(id) {
  return request({
    url: '/exam/report/opinion/getReport/' + id,
    method: 'get'
  })
}

export function getReportOpinionByProjectId(id) {
  return request({
    url: '/exam/report/opinion/getReportByProjectId/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/exam/report/opinion/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/exam/auditReports',
    method: 'put',
    data: obj
  })
}

export function submit(obj) {
  return request({
    url: '/exam/report/opinion/submit',
    method: 'post',
    data: obj
  })
}

export function submitAudit(obj) {
  return request({
    url: '/exam/report/opinion/submitAudit',
    method: 'post',
    data: obj
  })
}

export function saveEngineering(obj) {
  return request({
    url: '/exam/report/opinion/saveEngineering',
    method: 'post',
    data: obj
  })
}

export function submitEngineering(obj) {
  return request({
    url: '/exam/report/opinion/submitEngineering',
    method: 'post',
    data: obj
  })
}

/**
 * 生成定稿文书
 * @param obj
 * @returns {AxiosPromise}
 */
export function genWord(obj) {
  return request({
    url: '/exam/report/opinion/genWord',
    method: 'post',
    data: obj
  })
}
